﻿<UserControl x:Class="ExampleControl.Controls.GeometryTools.GeometrySettings"
	         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"  
             xmlns:ColourPicker="clr-namespace:ExampleControl.Controls.ColourPicker" 
	         mc:Ignorable="d">

    <Grid x:Name="LayoutRoot">

        <vsm:VisualStateManager.VisualStateGroups>
            <vsm:VisualStateGroup x:Name="ColourPickerState">
                <vsm:VisualStateGroup.Transitions>
                    <vsm:VisualTransition GeneratedDuration="00:00:00.3000000"/>
                </vsm:VisualStateGroup.Transitions>
                <vsm:VisualState x:Name="ShowColourPicker">
                    <Storyboard>
                    	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="_ColourPicker" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    		<SplineDoubleKeyFrame KeyTime="00:00:00" Value="173"/>
                    	</DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </vsm:VisualState>
                <vsm:VisualState x:Name="HideColourPicker">
                    <Storyboard>
                    	<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="_ColourPicker" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    		<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    	</DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </vsm:VisualState>
            </vsm:VisualStateGroup>
        </vsm:VisualStateManager.VisualStateGroups>

        <StackPanel>
            <StackPanel x:Name="GeometryButtons" Orientation="Horizontal" Height="28" HorizontalAlignment="Center" Margin="0,3,0,0">
                <ToggleButton x:Name="_FreeDrawToggleButton" Style="{StaticResource ToggleButtonStyle}">
                    <Image Source="../../Resources/GeometryTools/Draw.png" Stretch="Uniform"/>
                </ToggleButton>
                <ToggleButton x:Name="_StringLineToggleButton" Style="{StaticResource ToggleButtonStyle}">
                    <Image Source="../../Resources/GeometryTools/Line.png" Stretch="Uniform"/>
                </ToggleButton>
                <ToggleButton x:Name="_PolygonToggleButton" Style="{StaticResource ToggleButtonStyle}">
                    <Image Source="../../Resources/GeometryTools/Polygon.png" Stretch="Uniform"/>
                </ToggleButton>
                <ToggleButton x:Name="_PointPinToggleButton" Style="{StaticResource ToggleButtonStyle}">
                    <Image Source="../../Resources/GeometryTools/Pin.png" Stretch="Uniform"/>
                </ToggleButton>
                <ToggleButton x:Name="_EraserToggleButton" Style="{StaticResource ToggleButtonStyle}">
                    <Image Source="../../Resources/GeometryTools/Eraser.png" Stretch="Uniform"/>
                </ToggleButton>
            </StackPanel>

            <StackPanel VerticalAlignment="Top">
                <Border Background="#FF000000" CornerRadius="8,8,8,8" Margin="0,3,0,3" Padding="0,8,0,8">
                    <Grid x:Name="_GeometrySettings">

                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" MinHeight="20" />
                            <RowDefinition Height="Auto" MinHeight="0" />
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" MinWidth="62.667"  />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0" Grid.Row="0" Text="Label" Foreground="#FFFFFFFF" Margin="0,1,1,1" VerticalAlignment="Center" HorizontalAlignment="Right" />
                        <TextBlock Grid.Column="0" Grid.Row="1" Text="Visible" Foreground="#FFFFFFFF" Margin="0,1,1,1" VerticalAlignment="Center" HorizontalAlignment="Right" />
                        <TextBlock Grid.Column="0" Grid.Row="2" Text="Line Color" Foreground="#FFFFFFFF" Margin="0,1,1,1" VerticalAlignment="Center" HorizontalAlignment="Right" />
                        <TextBlock Grid.Column="0" Grid.Row="3" Text="Fill Color" Foreground="#FFFFFFFF" Margin="0,1,1,1" VerticalAlignment="Center" HorizontalAlignment="Right" />
                        <StackPanel Margin="0,2,0,2" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="Thickness" Foreground="#FFFFFFFF" />
                        </StackPanel>

                        <StackPanel Grid.Column="0" Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,1,0,1">
                            <TextBlock Text="Opacity" Foreground="#FFFFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,3,0" />
                            <TextBlock Text="%" Foreground="#FFFFFFFF" VerticalAlignment="Center" />
                        </StackPanel>

                        <TextBox x:Name="_LabelText" Grid.Column="1" Grid.Row="0" Text="{Binding Path=LabelText}" Margin="3,1,3,1" VerticalAlignment="Center" Height="18" HorizontalAlignment="Stretch" FontSize="9" />
                        <CheckBox x:Name="_LabelVisible" Grid.Column="1" Grid.Row="1" Foreground="#FFFFFFFF" Margin="3,1,0,1" VerticalAlignment="Center" />
                        <StackPanel Margin="3,1,0,1" Grid.Column="1" Grid.Row="2" Orientation="Horizontal">
                            <Button x:Name="_LineColour" Foreground="#FFFFFFFF" Style="{StaticResource StandardButton}" Height="21" >
                                <Image HorizontalAlignment="Left" Source="../../Resources/GeometryTools/Colour.png"/>
                            </Button>
                            <Rectangle x:Name="_LineColorDisplay" Fill="#FFFFFFFF" RadiusY="8" RadiusX="8" Stroke="#FF000000" Height="18" Margin="3,1,3,1" Width="75"/>
                        </StackPanel>
                        <StackPanel HorizontalAlignment="Stretch" Margin="3,1,0,1" Width="Auto" Grid.Column="1" Grid.Row="3" Orientation="Horizontal">
                            <Button x:Name="_FillColour" Foreground="#FFFFFFFF" Style="{StaticResource StandardButton}" Height="21" >
                                <Image HorizontalAlignment="Left" Source="../../Resources/GeometryTools/Colour.png"/>
                            </Button>
                            <Rectangle x:Name="_FillColourDisplay" Fill="#FFFFFFFF" RadiusY="8" RadiusX="8" Margin="3,1,3,1" Width="75" Stroke="#FF000000" Height="18"/>
                        </StackPanel>
                        <TextBox x:Name="_ThicknessValue" Grid.Column="1" Grid.Row="4"  Width="35" TextAlignment="Right" Margin="3,0,0,0" Height="18" FontSize="9" HorizontalAlignment="Left" />
                        <Slider x:Name="_LineThickness" Grid.Column="1" Grid.Row="4"  SmallChange="0.25" LargeChange="0.25" Maximum="10" Value="1" Style="{StaticResource SliderStyle}" Margin="38,1,3,1" HorizontalContentAlignment="Left"/>
                        <TextBox x:Name="_OpacityValue" Grid.Column="1" Grid.Row="5" Width="35" TextAlignment="Right" Height="18" FontSize="9" HorizontalAlignment="Left" Margin="3,0,0,0" />
                        <Slider x:Name="_Opacity" Grid.Column="1" Grid.Row="5" SmallChange="1" LargeChange="1" Maximum="100" Value="50" Style="{StaticResource SliderStyle}" Margin="38,1,3,1" HorizontalContentAlignment="Left" Orientation="Horizontal"/>
                    </Grid>
                </Border>
            	<ColourPicker:ColorPicker x:Name="_ColourPicker" Margin="0,3,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Height="0" />
            </StackPanel>

        </StackPanel>
    </Grid>

</UserControl>